package com.iss.lxhproject.service;

import com.iss.lxhproject.dao.RoomfreeDao;
import com.iss.lxhproject.dao.RoomfreeDao;
import com.iss.lxhproject.dao.RoomfulDao;
import com.iss.lxhproject.entity.Room;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class RoomfulService {
    @Autowired
    private RoomfulDao roomfulDao;
    public boolean insertRoom(String room_id,String room_type,String room_price,String room_state){
        Integer count = roomfulDao.insertRoom(room_id,room_type,room_price,room_state);
        if (count>0){
            return true;
        }else
            return false;
    }
    public boolean deleteRoom(String room_id){
        Integer count = roomfulDao.deletRoom(room_id);
        if (count>0){
            return true;
        }else
            return false;
    }
    public boolean updatetRoom(String room_id){
        Integer count = roomfulDao.updateRoom(room_id);
        if (count>0){
            return true;
        }else
            return false;
    }
    public boolean selectRoom(String room_id){
        Room room = roomfulDao.selectRoom(room_id);
        if(room!=null){
            return true;
        }else
            return false;
    }
    public List<Room> selectAllRooms(){
        List<Room> list =roomfulDao.selectAllRoom();

        return list;
    }
}
